﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LGE;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace UpUp
{
    class SplashScreen : GameScreen
    {
        Texture2D bg;
        double time = 2000;

        public override void LoadContent()
        {
            time = 2000;
            Audio.StopSong();
            bg = Engine.Load<Texture2D>("Images\\StartScreen\\splash");
            UpUp.isMouseVisible = false;
        }

        public override void Update(GameTime gameTime)
        {
            time -= gameTime.ElapsedGameTime.TotalMilliseconds;
            if (time < 0 || Input.KeyPressed(Keys.Enter) || Input.ButtonPressed(Buttons.Start))
            {
                GameScreenManager.ChangeScreen(new StartScreen());
                UpUp.isMouseVisible = true;
            }
            
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(bg, Vector2.Zero, Color.White);
        }
    }
}
